﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MuaChung.Models.WEBSERVICE>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ListAllService
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>ListAllService</h2>

    <table>
        <tr>            
            <th>
                URL
            </th>
            <th>
                Tên dịch vụ
            </th>
            <th>
                Tên tài khoản
            </th>
            <th>
                Mật khẩu
            </th>
            <th>
                Tên doanh nghiệp
            </th>
            <th>
                Loại
            </th>
            <th></th>  
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>            
            <td width="150px">
                    <% int lenght;
                       if (item.URL.Length > 15)
                       {
                           lenght = 15;
                       }
                       else
                       {
                           lenght = item.URL.Length;
                       }%>                    
                    <%: new HtmlString(item.URL.Substring(0,lenght) + "......") %>
                </td>
            <td width="120px">
                <%: item.Ten %>
            </td>
            <td>
                <%: item.WSUSERNAME %>
            </td>
            <td>
                <%: item.WSPASSWORD %>
            </td>
            <td>
                <%: item.DOANHNGHIEP.Ten_DoanhNghiep %>
            </td>
            <td>
                <%: item.LoaiWS %>
            </td>
            <td>
                <%: Html.ActionLink("Edit", "EditService", new { id=item.ID }) %> |                
                <%: Html.ActionLink("Delete", "DeleteService", new { id=item.ID })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%: Html.ActionLink("Thêm webservice", "AddNewService") %>
    </p>

</asp:Content>

